package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * License generated by hbm2java
 */
@Entity
@Table(name = "license")
public class License implements java.io.Serializable {

	private Long id;
	private IcaoLevel icaoLevel;
	private UserBaseInfo userBaseInfo;
	private LicenseName licenseName;
	private String licenseNumber;
	private Boolean status;
	private Date awardtime;
	private Date validtime;
	private String description;
	private Set<SkilledCheck> skilledChecks = new HashSet<SkilledCheck>(0);

	public License() {
	}

	public License(UserBaseInfo userBaseInfo, LicenseName licenseName,
			String licenseNumber) {
		this.userBaseInfo = userBaseInfo;
		this.licenseName = licenseName;
		this.licenseNumber = licenseNumber;
	}

	public License(IcaoLevel icaoLevel, UserBaseInfo userBaseInfo,
			LicenseName licenseName, String licenseNumber, Boolean status,
			Date awardtime, Date validtime, String description,
			Set<SkilledCheck> skilledChecks) {
		this.icaoLevel = icaoLevel;
		this.userBaseInfo = userBaseInfo;
		this.licenseName = licenseName;
		this.licenseNumber = licenseNumber;
		this.status = status;
		this.awardtime = awardtime;
		this.validtime = validtime;
		this.description = description;
		this.skilledChecks = skilledChecks;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ICAO_LEVEL")
	public IcaoLevel getIcaoLevel() {
		return this.icaoLevel;
	}

	public void setIcaoLevel(IcaoLevel icaoLevel) {
		this.icaoLevel = icaoLevel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER", nullable = false)
	public UserBaseInfo getUserBaseInfo() {
		return this.userBaseInfo;
	}

	public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
		this.userBaseInfo = userBaseInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "LICENSE_NAME", nullable = false)
	public LicenseName getLicenseName() {
		return this.licenseName;
	}

	public void setLicenseName(LicenseName licenseName) {
		this.licenseName = licenseName;
	}

	@Column(name = "LICENSE_NUMBER", nullable = false, length = 30)
	public String getLicenseNumber() {
		return this.licenseNumber;
	}

	public void setLicenseNumber(String licenseNumber) {
		this.licenseNumber = licenseNumber;
	}

	@Column(name = "STATUS")
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "AWARDTIME", length = 10)
	public Date getAwardtime() {
		return this.awardtime;
	}

	public void setAwardtime(Date awardtime) {
		this.awardtime = awardtime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "VALIDTIME", length = 10)
	public Date getValidtime() {
		return this.validtime;
	}

	public void setValidtime(Date validtime) {
		this.validtime = validtime;
	}

	@Column(name = "DESCRIPTION", length = 200)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "license")
	public Set<SkilledCheck> getSkilledChecks() {
		return this.skilledChecks;
	}

	public void setSkilledChecks(Set<SkilledCheck> skilledChecks) {
		this.skilledChecks = skilledChecks;
	}

}
